<?php
declare (strict_types=1);

namespace app\common\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class ExampleDownload extends Model
{
    protected $connection = 'bairui';
    //  连接表名
    protected $name = 'example_download';
    //  自动写入时间戳字段
    protected $createTime = 'created_at';
    protected $updateTime = 'updated_at';

    // 关联 member用户表
    public function getmember()
    {
        return $this->hasOne(ApiMember::class, 'id', 'member_id')->field('id,account');
    }

    // 关联 实例表
    public function getexample()
    {
        return $this->hasOne(Example::class, 'id', 'example_id')->field('id,title');
    }
}
